using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SkillManager : MonoBehaviour
{
    public static SkillManager instance;// 单例模式，全局通过SkillManager.instance访问

    public Dash_Skill dash { get; private set; }// 获取冲刺技能脚本
    public Clone_Skill clone { get; private set; }// 获取克隆技能脚本
    public Sword_Skill sword { get; private set; }// 获取掷剑技能脚本
    public Blackhole_Skill blackhole { get; private set; }// 获取黑洞技能脚本
    public Crystal_Skill crystal { get; private set; }// 获取水晶技能脚本
    public Parry_Skill parry { get; private set; }// 获取格挡技能脚本
    public Dodge_Skill dodge { get; private set; }// 获取闪避技能脚本

    private void Awake()
    {
        if (instance != null)
        {
            Destroy(instance.gameObject);// 摧毁实例
        }
        else
        {
            instance = this;
        }
    }

    private void Start()
    {
        dash = GetComponent<Dash_Skill>();// 注册冲刺技能
        clone = GetComponent<Clone_Skill>();// 注册冲刺技能
        sword = GetComponent<Sword_Skill>();// 注册掷剑技能
        blackhole = GetComponent<Blackhole_Skill>();// 注册黑洞技能
        crystal = GetComponent<Crystal_Skill>();// 注册水晶技能
        parry = GetComponent<Parry_Skill>();// 注册格挡技能
        dodge = GetComponent<Dodge_Skill>();// 注册格挡技能
    }
}
